- cache [ 'navbar', I18n.locale, current_user ] do
  nav.navbar.fixed-top.navbar-expand-md.navbar-dark.bg-dark
    .container
      a.navbar-brand href=root_path
        | DockerRails

      button.navbar-toggler {
        aria-controls="navbarSupportedContent"
        aria-expanded="false"
        aria-label=("Toggle navigation")
        data-target="#navbarSupportedContent"
        data-toggle="collapse"
        type="button"
      }
        span.navbar-toggler-icon

      #navbarSupportedContent.collapse.navbar-collapse
        ul.navbar-nav.mr-auto

        - if signed_in?
          = link_to new_post_path, \
              class: 'btn btn-primary btn-sm mr-2',
              id: 'add-new-post',
              title: 'Add new Post',
              data: { toggle: 'tooltip', placement: 'bottom' } do
            i.fa.fa-plus

          - if current_user.is_admin?
            = link_to sidekiq_web_path, \
                class: 'btn btn-light btn-sm mr-2',
                title: 'Sidekiq',
                data: { turbolinks: 'false', toggle: 'tooltip', placement: 'bottom' } do
              i.fas.fa-cogs

            = link_to blazer_path, \
                class: 'btn btn-light btn-sm mr-2',
                title: 'Blazer',
                data: { turbolinks: 'false', toggle: 'tooltip', placement: 'bottom' } do
              i.fa.fa-binoculars

          .nav-item.dropdown
            a.btn.btn-light.btn-sm.dropdown-toggle {
              aria-expanded="false"
              aria-haspopup="true"
              data-toggle="dropdown"
              href="#"
              role="button"
            }
              i.fa.fa-user-circle
              '
              = current_user.email
              '
              span.caret
            .dropdown-menu
              = link_to sign_out_path, class: 'dropdown-item', method: :delete do
                = I18n.t('layouts.application.sign_out')

        - else
          = link_to sign_up_path, class: 'btn btn-light btn-sm mr-2' do
            i.fa.fa-user-plus
            '
            = I18n.t("layouts.application.sign_up")

          = link_to sign_in_path, class: 'btn btn-light btn-sm' do
            i.fa.fa-user-circle
            '
            = I18n.t("layouts.application.sign_in")
